class SeatManager
{
public:
    SeatManager(int n)
    {
        for (int i = 1; i <= n; ++i)
        {
            available.push(i);
        }
    }

    int reserve()
    {
        int minAvailable = this->available.top();
        this->available.pop();
        return minAvailable;
    }

    void unreserve(int seatNumber)
    {
        this->available.push(seatNumber);
    }

private:
    priority_queue<int, vector<int>, greater<int>> available;
};

/**
 * Your SeatManager object will be instantiated and called as such:
 * SeatManager* obj = new SeatManager(n);
 * int param_1 = obj->reserve();
 * obj->unreserve(seatNumber);
 */